Method and apparatus for determining image orientation

ABSTRACT

A method and apparatus for automatically deciding on the orientation of image. The method includes computing average and standard deviation of luminance of the top region of a portion of the image, of the bottom region of a portion of the image, of the left region of a portion of the image, and of the right region of a portion of the image, computing average luminance of the image, computing, in the digital signal processor, consolidated luminance difference and uniformity of top and bottom regions, and left and right regions, utilizing the computed average and standard deviation of at least one of the bottom region, the left region or the right region and utilizing portrait orientation if difLR−difTB&gt;t 1  &amp;&amp; stdTB−stdLR&gt;t 2  or if difLR−difTB&gt;t 3  &amp;&amp; stdTB−stdLR&gt;t 4 , otherwise, utilizing landscape orientation.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims benefit of U.S. provisional patent applicationSer. No. 61/111,081, filed Nov. 4, 2008, which is herein incorporated byreference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Embodiments of the present invention generally relate to a method andapparatus for orientation detection of an image.

2. Description of the Related Art

Digital cameras are widely used by consumers. At normal shootingposition, a consumer obtains a landscape image. However, the consumersometimes obtains a portrait image by rotating the camera. We show anexample of different image orientation in FIG. 1. The top two imageshave 0 degree and 180 degree orientation, also known as landscapeorientation. The bottom two images have 90 degree and 270 degreeorientation, also known as portrait orientation.

Images with wrong orientation (90, 180, 270 degree) should be correctedfor camera users. Otherwise, camera users need to correct them manually.Also, many image processing and computer vision algorithms (e.g.content-based image retrieval, face or object detection) assume that thetop of the image corresponds to the top of the scene, which is not truefor images with wrong orientation. If the camera does not correct 180,90, or 270 degree orientation, these algorithms cannot work properly.After image orientation has been detected, a computer can easily correctorientation by rotating the image.

High-end digital cameras are equipped with motion sensors that detectcamera rotation. However, low-end digital cameras or camera phonescannot afford them. For those cameras, camera users perform imageorientation detection and correction manually. It is challenging todetect image orientation automatically. Some image orientationalgorithms have been proposed for image processing applications ondesktop PC. However, they are too complex to be implemented on thedigital cameras. Also, a desirable method for digital cameras should beuniversal, since digital cameras will be used to capture different kindsof images. It also should have low computation complexity and lowmemory, due to the cost and shot-to-shot constraints of digital cameras.

Therefore, there is a need for an improved method and/or apparatus fordetermining image orientation.

SUMMARY

Embodiments of the current invention relate to a method and apparatusfor automatically deciding on the orientation of image. The methodincludes computing average and standard deviation of luminance of thebottom region of a portion of the image, of left region of a portion ofthe image, and of the right region of a portion of the image, computingaverage luminance of the image, computing, in the digital signalprocessor, consolidated luminance difference and uniformity of top andbottom regions, and left and right regions, utilizing the computedaverage and standard deviation of at least one of the bottom region, theleft region or the right region and utilizing portrait orientation ifdifLR−difTB>t1 && stdTB−stdLR>t2 or if difLR−difTB>t3 && stdTB−stdLR>t4,otherwise, utilizing landscape orientation.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above recited features of the presentinvention can be understood in detail, a more particular description ofthe invention, briefly summarized above, may be had by reference toembodiments, some of which are illustrated in the appended drawings. Itis to be noted, however, that the appended drawings illustrate onlytypical embodiments of this invention and are therefore not to beconsidered limiting of its scope, for the invention may admit to otherequally effective embodiments.

FIG. 1 is an embodiment depicting an image captured in differentorientations;

FIG. 2 is an embodiment depicting various regions of an image; and

FIG. 3 is a flow diagram depicting an embodiment of a method forautomatically determining image orientation.

DETAILED DESCRIPTION

One distinguishes between portrait orientation (90 and 270 degrees) fromlandscape orientation (0 and 180 degree). Luminance values are used inimage processing in many literatures. The luminance level of each pixelis computed asY=0.2125R+0.7154G+0.0721B.

One observation is that the top or bottom of scene usually has largeluminance deviation from the average luminance of the image. Anotherobservation is that the top or bottom of scene usually has uniformluminance distribution. For example, images may have sky, cloud, grass,snow, road, or dark background in the top or bottom part.

Using local luminance mean and variance, one detects the imageorientation. Specifically, one computes the average and standarddeviation of luminance of the top region. FIG. 2 is an embodimentdepicting various regions of an image. The height of the region may be10% of the image height and the width is equal to the image width.

FIG. 3 is a flow diagram depicting an embodiment of a method forautomatically determining image orientation. The method 300 starts atstep 301 and proceeds to step 304. At step 302, the method 300 computesthe average and standard deviation of luminance of the top region, asshown in FIG. 2, which are herein denote by aveT, and stdT. The heightof the region may be 10% of the image height and the width is equal tothe image width. At step 304, the method 300 computes the average andstandard deviation of luminance of the bottom region, as shown in FIG.2, which are herein denote by aveB, and stdB. The height of the regionmay be 10% of the image height and the width is equal to the imagewidth. At step 306, the method 300 computes the average and standarddeviation of luminance of the left region, as shown in FIG. 2, which aredenoted by aveL, and stdL. The height of the region is equal to theimage height and the width may be 10% of the image width.

At step 308, the method 300 computes the average and standard deviationof luminance of the right region, as shown in FIG. 2. The height of theregion is equal to the image height and the width may be 10% of theimage width, which are denoted them by aveR, and stdR. At step 310, themethod 300 computes the average luminance of the whole image, denoted byaveImg. At step 312, the method 300 computes the consolidated luminancedifference and uniformity of top and bottom regionsdifTB=max(|aveT−aveImg|,|aveB−aveImg|);stdTB=min(stdT,stdB).At step 314, the method 300 computes the consolidated luminancedifference and uniformity of left and right regionsdifLR=max(|aveL−aveImg|,|aveR−aveImg|);stdLR=min(stdL,stdR).At step 316, the method 300 decides on the following way:If difLR−difTB>t1 && stdTB−stdLR>t2, portrait orientation;If difLR−difTB>t3 && stdTB−stdLR>t4, portrait orientation;

-   -   Otherwise, landscape orientation.        In this embodiment, t1, t2, t3, and t4 are four parameters. They        are set to 2.5, 3.5, 11.5, and −28. The method 300 ends at step        318.

After distinguishing the portrait orientation from landscapeorientation, further, classification may be performed. Images capturedby digital cameras rarely have 180 degree orientation. However, if animage is detected as landscape orientation, it is detected as 0 degreeorientation. Images captured by a given digital camera usually haveeither 90 degree or 270 degree orientation, but not both. In thisembodiment, one orientation may be specified, after an image has beendetected as portrait orientation. Further classification may beperformed as follows:If aveR−aveL>t5 && devL−devR>t6 && aveR<t7Here t5, t6, and t7 are three parameters. In current implementation,they are set to 76, −10, and 150.

Currently, some orientation detection algorithms are proposed fordigital images, for example. However, these algorithms apply complexfeature extraction or object detection on the images, resulting in highcomputational complexity and high memory requirement. One embodimentutilizes luminance mean and variance to simplify orientation detection.

The main advantages of our approach are as follows: (a) Our approach hasvery low computation complexity; (b) Our approach has very low memoryrequirement; and (c) Our approach can be easily implemented on existinghardware image processors. The main computation is computing average andstandard deviation of luminance in four regions, which can be performedby H3A of TI image processors.

While the foregoing is directed to embodiments of the present invention,other and further embodiments of the invention may be devised withoutdeparting from the basic scope thereof, and the scope thereof isdetermined by the claims that follow.

What is claimed is:
 1. A method of a digital signal processor forautomatically deciding on the orientation of image, the methodcomprising: computing average and standard deviation of luminance of thetop region of a portion of the image, of the bottom region of a portionof the image, of the left region of a portion of the image, and of theright region of a portion of the image; computing average luminance ofthe image; computing, in the digital signal processor, consolidatedluminance difference and uniformity of top and bottom regions, and leftand right regions, utilizing the computed average and standard deviationof at least one of the bottom region, the left region or the rightregion, wherein the consolidated luminance difference of top and bottomregions isdifTB=max(|aveT−aveImg|,|aveB−aveImg|); consolidated luminanceuniformity of top and bottom regions isstdTB=min(stdT,stdB), consolidated luminance difference and uniformityof left and right regions isdifLR=max(|aveL−aveImg|,|aveR−aveImg|), consolidated luminancedifference and uniformity of left and right regions isstdLR=min(stdL,stdR); and utilizing portrait orientation ifdifLR−difTB>t1 && stdTB−stdLR>t2 or if difLR−difTB>t3 && stdTB−stdLR>t4,otherwise, utilizing landscape orientation.
 2. An apparatus forautomatically deciding on the orientation of image, comprising: meansfor computing average and standard deviation of the top region of aportion of the image, of luminance of the bottom region of a portion ofthe image, of the left region of a portion of the image, and of theright region of a portion of the image; means for computing averageluminance of the image; means for computing, in the digital signalprocessor, consolidated luminance difference and uniformity of top andbottom regions, and left and right regions, utilizing the computedaverage and standard deviation of at least one of the bottom region, theleft region or the right region, wherein the consolidated luminancedifference of top and bottom regions isdifTB=max(|aveT−aveImg|,|aveB−aveImg|), consolidated luminanceuniformity of top and bottom regions isstdTB=min(stdT,stdB), consolidated luminance difference and uniformityof left and right regions isdifLR=max(|aveL−aveImg|,|aveR−aveImg|), consolidated luminancedifference and uniformity of left and right regions isstdLR=min(stdL,stdR); and means for utilizing portrait orientation ifdifLR−difTB>t1 && stdTB−stdLR>t2 or if difLR−difTB>t3 && stdTB−stdLR>t4,otherwise, utilizing landscape orientation.
 3. A non-transitory computerreadable medium comprising computer instructions, when executed, performa method for automatically deciding on the orientation of image, themethod comprising: computing average and standard deviation of the topregion of a portion of the image, of luminance of the bottom region of aportion of the image, of the left region of a portion of the image, andof the right region of a portion of the image; computing averageluminance of the image; computing, in the digital signal processor,consolidated luminance difference and uniformity of top and bottomregions, and left and right regions, utilizing the computed average andstandard deviation of at least one of the bottom region, the left regionor the right region, wherein the consolidated luminance difference oftop and bottom regions isdifTB=max(|aveT−aveImg|,|aveB−aveImg|); consolidated luminanceuniformity of top and bottom regions isstdTB=min(stdT,stdB), consolidated luminance difference and uniformityof left and right regions isdifLR=max(|aveL−aveImg|,|aveR−aveImg|), consolidated luminancedifference and uniformity of left and right regions isstdLR=min(stdL,stdR); and utilizing portrait orientation ifdifLR−difTB>t1 && stdTB−stdLR>t2 or if difLR−difTB>t3 && stdTB−stdLR>t4,otherwise, utilizing landscape orientation.